<template>
<tree-selector 
  ref="roleTreeRef"
  v-bind="$props"
  tree-title="角色"
  />
</template>

<script setup>
import { ref } from 'vue'
import TreeSelector from '@/components/treeSelector/TreeSelector'
// 定义 props
/* const props = defineProps({
  treeData: {
    type: Array,
    default: () => []
  },
  // 添加 dataApi 属性，用于从后台获取数据
  dataApi: {
    type: String,
    default: ''
  },
  dataKey:{
    type: String,
    default: 'id'
  },
  onConfirm: Function,
  onCancel: Function,
  visible: {
    type: Boolean,
    default: false
  }
}) */

// 组件引用
const roleTreeRef = ref()
const selectRole = (selectedIds = [], callback, limitCount = 0) => {
    roleTreeRef.value.selectTreeDialog(selectedIds, callback, limitCount)
}

// 暴露方法给父组件
defineExpose({
  selectRole
})
</script>